//
//  Book.m
//  17-文件管理沙盒目录
//
//  Created by dllo on 16/8/5.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "Book.h"

@implementation Book
// 读(取值)
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _bookType = [aDecoder decodeObjectForKey:@"_bookType"];
        _bookPrice = [aDecoder decodeObjectForKey:@"_bookPrice"];
        _bookName = [aDecoder decodeObjectForKey:@"_bookName"];
        _bookAuthor = [aDecoder decodeObjectForKey:@"_bookAuthor"];
        _bookAddress = [aDecoder decodeObjectForKey:@"_bookAddress"];
            }
    
    return self;
}
// 写(赋值)
- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_bookAddress forKey:@"_bookAddress"];
    [aCoder encodeObject:_bookAuthor forKey:@"_bookAuthor"];
    [aCoder encodeObject:_bookName forKey:@"_bookName"];
    [aCoder encodeObject:_bookPrice forKey:@"_bookPrice"];
    [aCoder encodeObject:_bookType forKey:@"_bookType"];

}
@end
